Skip to content

feat: add server/discover model types#943

Open
howardjohn wants to merge 1 commit into
modelcontextprotocol:mainfrom
howardjohn:john/sep-2575-server-discover
Open

feat: add server/discover model types#943
howardjohn wants to merge 1 commit into
modelcontextprotocol:mainfrom
howardjohn:john/sep-2575-server-discover

Conversation

@howardjohn

Copy link
Copy Markdown
Contributor

Motivation and Context

Add the SEP-2575 server/discover request and result model, wire it into the JSON-RPC request/result unions, and cover basic serde routing.

This only handles the basic model currently and does not wire up the server/client implementations, which will take some broader work around fallback to initialize etc.

For #869

How Has This Been Tested?

Tested in Agentgateway

Breaking Changes

None

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

@howardjohn howardjohn requested a review from a team as a code owner June 29, 2026 16:13
@github-actions github-actions Bot added T-test Testing related changes T-core Core library changes T-handler Handler implementation changes T-model Model/data structure changes labels Jun 29, 2026
@DaleSeo

DaleSeo commented Jun 30, 2026

Copy link
Copy Markdown
Member

@howardjohn Could you please get CI to green? Thanks!

@howardjohn howardjohn force-pushed the john/sep-2575-server-discover branch from 7c0c7f2 to 0f7d76e Compare July 1, 2026 16:49
@github-actions github-actions Bot added the T-config Configuration file changes label Jul 1, 2026
Add the SEP-2575 server/discover request and result model,
wire it into the JSON-RPC request/result unions, and cover basic serde routing.

Fixes modelcontextprotocol#869
@howardjohn howardjohn force-pushed the john/sep-2575-server-discover branch from 0f7d76e to 33268aa Compare July 1, 2026 16:53
@howardjohn

Copy link
Copy Markdown
Contributor Author

Shoudl be good now except the SemverCheck, apparently it needs a new major version to add a new enum 🤔

DaleSeo
DaleSeo previously approved these changes Jul 10, 2026

@DaleSeo DaleSeo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @howardjohn, sorry for getting to this late. We needed to wrap up the v2 work before jumping into implmenting the new spec. I left a couple of comments.

Shoudl be good now except the SemverCheck, apparently it needs a new major version to add a new enum 🤔

Can you rebase the branch? If it still fails the SemverCheck, make sure the commit message starts with feat!: and explain the breaking changes in the PR description.

Comment thread crates/rmcp/src/model.rs
Comment on lines +820 to +828
pub struct DiscoverResult {
pub supported_versions: Vec<ProtocolVersion>,
pub capabilities: ServerCapabilities,
pub server_info: Implementation,
#[serde(skip_serializing_if = "Option::is_none")]
pub instructions: Option<String>,
#[serde(rename = "_meta", skip_serializing_if = "Option::is_none")]
pub meta: Option<Meta>,
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The draft schema shows that this struct needs more fields.

Image

https://modelcontextprotocol.io/specification/draft/schema#discoverresult

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebase onto main and use the ResultType introduced by #915.

impl ResultType {
pub const COMPLETE: Self = Self(Cow::Borrowed("complete"));
pub const INPUT_REQUIRED: Self = Self(Cow::Borrowed("input_required"));

Comment thread crates/rmcp/src/model.rs
const_string!(DiscoverRequestMethod = "server/discover");

/// Sent from the client to discover server identity, capabilities, and supported protocol versions.
pub type DiscoverRequest = Request<DiscoverRequestMethod, EmptyObject>;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EmptyObject would allow:

{
  "method": "server/discover",
  "params": {}
}

Is this intended?

@DaleSeo DaleSeo self-requested a review July 10, 2026 13:23
@DaleSeo DaleSeo dismissed their stale review July 10, 2026 15:20

need to address feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2026-07-28 T-config Configuration file changes T-core Core library changes T-handler Handler implementation changes T-model Model/data structure changes T-test Testing related changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants